﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TournamentOrganizerWPF
{
    [Serializable]
    public class Match
    {
        public int MatchId { get; set; }
        public Player Player1 { get; set; }
        public Player Player2 { get; set; }
        public int TableNo { get; set; }
        public Player WinningPlayer { get; set; }
        public int ControlPointsPlayer1 { get; set; }
        public int ControlPointsPlayer2 { get; set; }

        public Match(int id, Player player1, Player player2, int tableNo)
        {
            MatchId = id;
            this.Player1 = player1;
            this.Player2 = player2;
            this.TableNo = tableNo;
            ControlPointsPlayer1 = 0;
            ControlPointsPlayer2 = 0;


           // player1.Opponents.Add(player2);
           // player2.Opponents.Add(player1);
        }
        
        public override String ToString()
        {
            return  "Playing on table " + TableNo + ": " + Player1.Name + " vs " + Player2.Name + "\t Winner: " + WinningPlayer ;
        }
    }

   
}
